package com.zzq.goods.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.zzq.common.core.annotation.DomainAdd;
import com.zzq.common.core.annotation.DomainEdit;
import com.zzq.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString
public class MyGoods extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 商品id
     */
    @TableId(type = IdType.INPUT)
    @NotEmpty(message = "id不能为空", groups = {DomainEdit.class})
    private String id;

    /**
     * 商品名称
     */
    @NotEmpty(message = "商品名称不能为空", groups = {DomainAdd.class, DomainEdit.class})
    private String goodsName;

    /**
     * 商品库存
     */
    @NotNull(message = "商品库存不能为空", groups = {DomainAdd.class, DomainEdit.class})
    private Long goodsStock;

}
